import java.util.Arrays;
import java.util.Scanner;

public class Test03 {

    //组队竞赛
    // 贪心算法
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()){
            int n = sc.nextInt();
            int[] arr = new int[n*3];
            for (int i = 0; i < 3*n; i++) {
                arr[i] = sc.nextInt();
            }
            Arrays.sort(arr);
            int sum = 0;
            for (int i = 0; i < n; i++) {
                sum += arr[arr.length - 2 * (i + 1)];
            }
            System.out.println(sum);
        }
    }
}
